--
-- Author: shunguo.chen
-- Date: 2018-06-08 14:15:34
--
-- IMOpenBtn 聊天打开按钮，可能会被添加到各种界面，用来打开了解界面

local ClassRef = app.mvc.createRenderClass(...)

function ClassRef.createWithData(data, node)
	local sprite = ClassRef.extend(node or cc.CSLoader:createNode(Res.IMOpenBtnNode))
	sprite:init(data)
	return sprite
end

function ClassRef.create(node)
	return ClassRef.createWithData(nil, node)
end

function ClassRef:init(data)
	self.super.init(self, data)

	display.doLayout(self)
	self._ui.Button_open:setEnabled(true)
	self._ui.Button_open:addClickEventListener(function()
		executeFunc(self._onClick)
		self:setVisible(false)
	end)
end

function ClassRef:refresh()

end

function ClassRef:onBtnClick(cb)
    self._onClick = cb
end

return ClassRef